<?php

use Faker\Factory;
use Illuminate\Database\Seeder;
use App\System\Cis\Model\CisOrg;

class CisOrgTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(CisOrg $cisOrg)
    {
        //先清空表
        $cisOrg->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 1; $i <= 5; $i++) {
            $cisOrg->insert([
                'org_name'      => '分店1' . $i,
                'org_full_name' => '广州市天河区唯意定制分店' . $i,
                'org_tel'       => $faker->PhoneNumber,
                'type'          => mt_rand(1, 2),
                'description'   => '这家店很懒，什么都没有留下。',
                'url'           => 'http://localhost/seller/index',
                'region_id'     => '0',
                'address'       => $faker->address,
                'zip_code'      => '510000',
                'contact_name'  => $faker->name,
                'contact_email' => $faker->email,
                'contact_tel'   => $faker->PhoneNumber,
                'status'        => mt_rand(1, 2),
                'created_at'    => date('Y-m-d H:i:s'),
            ]);
        }
    }
}
